package fristphase.submarinegame08complete;

import javax.swing.*;

public class BattleShip extends SeaObject {
    private int life;
    public BattleShip(){
        super(60,20,34,124,6,"战舰");
        life = 5;
    }

    public void move(){
        System.out.println("战舰移动");
    }
    public ImageIcon getImage(){
        return Images.battleship;
    }
    public Bomb shootBomb(){
        return new Bomb(x+width/2,y+height+2);
    }
    public void moveLeft(){
        x -= speed;
    }
    public void moveRight(){
        x += speed;
    }
    public void addLife(int life){
        this.life += life;
    }
    public int getLife(){
        return this.life;
    }
    public void subtractLife(){
        this.life -=1;
    }
}
